/**
 * 评论模块
 */

import request from "@/utils/request"


/**
 * 获取文章评论列表
 * @param {*} params 
 */
export const getArticleComment = params => {
    return request({
        url:'/v1_0/comments',
        method:"GET",
        params
    })
}

/**
 * 评论点赞
 * @param {*} target
 */
export const addLike = target => {
    return request({
        url: '/v1_0/comment/likings',
        method: "post",
        data:{
            target
        }
    })
}

/**
 * 评论取消点赞
 * @param {*} target
 */
export const deleteLike = target => {
    return request({
        url: `/v1_0/comment/likings/${target}`,
        method: "delete"
    })
}

/**
 * 添加评论
 * @param {*} data 
 */
export const addComment = data=>{
    return request({
        method:"post",
        url:'/v1_0/comments',
        data
    })
}